import request from '@/utils/request'
import qs from 'qs'
import {headers} from '@/utils/request'

export default {
  projects(){return request.get('/mybatis/projects')},
  projectFiles(project){return request.get(`/mybatis/${project}/files`) },
  fileContent(project,fileName){return request.get(`/mybatis/${project}/${fileName}/content`)},
  statementInfo(project,fileName,classLoaderName){return request.get(`/mybatis/${project}/${fileName}/statementInfo`,{params: {classLoaderName}})},
  boundSql(params){return request.post('/mybatis/boundSql',params,headers.json)},

  uploadFiles(project,formData){ return request.post(`/mybatis/${project}/uploadFiles`, formData)},
  dropFiles(project,fileNames){return request.post(`/mybatis/${project}/dropFiles`,qs.stringify({project,fileNames}),headers.urlencoded)}
}
